package com.liehu.user.service;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.liehu.user.dao.RoleMapper;
import com.liehu.user.pojo.Role;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class RoleService{
    @Autowired
    private RoleMapper roleMapper;
    //根据id查询
    public Role findById(String id){
        return roleMapper.selectById(id);
    }
    //查询所有
    public List<Role> findAll(){
        return roleMapper.selectList(null);
    }
}
